<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page session="false" %>
<%@ page isELIgnored ="false" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<span style="display:none">To solve IE7/8 script event tag problem.</span>
<div data-dojo-type="dijit.layout.BorderContainer" style="width:100%;height:100%;padding:0px;margin:-8px;" data-dojo-props="design:'sidebar'">
	<div data-dojo-type="dijit.layout.ContentPane"  data-dojo-props="region:'top'" style="border:none;border-bottom:1px solid #999;padding:8px 15px;background-color:#E8ECEF" class="navbar">&nbsp;
		<script type="dojo/method" data-dojo-event="onShow">
			this.set("content",AppCenter.resource("appcenter")+
			<c:forEach items="${path}" var="cat" varStatus="status">
				<c:choose>
					<c:when test="${status.last}">
						"&nbsp; &gt; &nbsp;<strong>"+AppCenter.resource("${cat.label}")+"</strong>"
					</c:when>
					<c:otherwise>
						"&nbsp; &gt; &nbsp;<a href=\"#\" onClick=\"$ku.loadDojoExt({url:'../applist/${cat.id}.html',target:'mainext'});return false;\">"+AppCenter.resource("${cat.label}")+"</a>" +
					</c:otherwise>
				</c:choose>
			</c:forEach>);

			var apps = dojo.query(".appTitle",this.domNode.parentNode);
			var ttl;
			dojo.forEach(apps, function(item, index, arr){
				item.innerHTML = AppCenter.resource(item.id,null,item.innerHTML);
				return false;
        	});

		</script>
	</div>

	<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'center'" style="padding:5px;margin:5px;border:none;" >
		<c:forEach items="${modules}" var="module">
		<c:choose>
			<c:when test="${module.accessURL==null}">
				<div class="appIcon" onclick="$ka.parentModule('${module.id}',null,{target:'moduleContainer',i18nResource:AppCenter._resource});">
					<div><span class="dijitInline" >
						<c:choose>
							<c:when test="${fn:indexOf(module.iconXL,'http://')==0}">
								<img src="${module.iconXL}" width="48" height="48" />
							</c:when>
							<c:when test="${fn:indexOf(module.iconXL,'/')==0}">
								<img src="${pageContext.request.contextPath}${module.iconXL}" width="48" height="48" />
							</c:when>
							<c:otherwise>
								<img src="${module.iconXL}" width="48" height="48" />
							</c:otherwise>
						</c:choose>
					</span></div>
					<span id="${module.id}" class="appTitle dijitInline">${module.name}</span>
				</div>
			</c:when>
			<c:otherwise>
				<sec:authorize url="${module.accessURL}">
				<div class="appIcon" onclick="$ka.parentModule('${module.id}',null,{target:'moduleContainer',i18nResource:AppCenter._resource});">
					<div><span class="${module.iconXL} dijitInline" ></span></div>
					<span class="appTitle dijitInline">${module.name}</span>
				</div>
				</sec:authorize>
			</c:otherwise>
		</c:choose>
		</c:forEach>
	</div>
</div>